BIN=bite.exe
#SRC=$(shell ls *.c)
SRC=$(wildcard *.c)
OBJ=$(SRC:.c=.o)
CC=gcc
Echo=echo
Rm=rm

$(BIN):$(OBJ)
	@$(CC) $^ -o $@
	@$(Echo) "linking $^ to $@ ,,, done"
%.o:%.c
	@$(CC) -c $<
	@$(Echo) "compling $< to $@ ... done"

.PHONY:clean
clean:
	$(Rm) -f $(OBJ) $(BIN)

.PHONY:test
test:
	@echo "Debug------"
	@echo $(SRC)
	@echo "Debug------"
	@echo $(OBJ)
	@echo "Debug------"

#BIN=hello.exe
#SRC=test.c
#
#$(BIN):$(SRC)
#	gcc $^ -o $@
#	@echo "开始编译代码"
#.PHONY:clean
#clean:
#	@echo "清理工程..."
#	rm -f $(BIN)
#	@echo "清理完毕..."
